package com.space.feign.i;

import feign.Headers;
import feign.Param;
import feign.RequestLine;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author <a href="mailto:414563035@qq.com">Bedroom</a>
 * @date 2021/5/17 3:37 下午
 */
public interface CosServiceFeign {
    @RequestLine("POST /cos/putFileObject")
    @Headers("Content-Type: multipart/form-data")
    Object putObject(@RequestPart("file") MultipartFile file);

    @RequestLine("GET /cos/getObjectAsString?key=${key}")
    @Headers("Content-Type: application/json")
    Object getObjectAsString(@Param("key") String key);

    @RequestLine("GET /cos/getGeneratePresignedUrl?key=${key}")
    @Headers("Content-Type: application/json")
    Object getGeneratePresignedUrl(@Param("key") String key);

    @RequestLine("GET /cos/deleteObject?key=${key}")
    @Headers("Content-Type: application/json")
    Object deleteObject(@Param("key") String key);
}